package com.amazon.ags.client.achievements;

import com.amazon.ags.api.ErrorCode;
import com.amazon.ags.api.achievements.Achievement;
import com.amazon.ags.api.achievements.GetAchievementsResponse;
import com.amazon.ags.client.RequestResponseImp;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class GetAchievementsResponseImp extends RequestResponseImp
  implements GetAchievementsResponse
{
  private List<Achievement> achievements = null;
  private Map<String, Achievement> achievementsMap = null;

  public GetAchievementsResponseImp(int paramInt, ErrorCode paramErrorCode)
  {
    super(paramInt, paramErrorCode);
  }

  public GetAchievementsResponseImp(List<Achievement> paramList, int paramInt)
  {
    super(paramInt);
    this.achievements = paramList;
  }

  public final List<Achievement> getAchievementsList()
  {
    return this.achievements;
  }

  public final Map<String, Achievement> getAchievementsMap()
  {
    if (this.achievements == null)
      return null;
    if (this.achievementsMap == null)
    {
      this.achievementsMap = new HashMap();
      Iterator localIterator = this.achievements.iterator();
      while (localIterator.hasNext())
      {
        Achievement localAchievement = (Achievement)localIterator.next();
        this.achievementsMap.put(localAchievement.getId(), localAchievement);
      }
    }
    return this.achievementsMap;
  }

  public final int getEventType()
  {
    return 17;
  }

  public final int getNumVisibleAchievements()
  {
    if (this.achievements != null)
      return this.achievements.size();
    return 0;
  }

  public final String toString()
  {
    String str = super.toString();
    return str + "\n Number of AchievementsClient Returned: " + getNumVisibleAchievements();
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.amazon.ags.client.achievements.GetAchievementsResponseImp
 * JD-Core Version:    0.6.2
 */